Skip to content

Conversation

Cenngo
Copy link
Collaborator

@Cenngo Cenngo commented Apr 10, 2022

Moves ModalUtils class to public, adds a ConfirmAsync overload to be used with SocketInteractions and SendModalAsync() method to InteractionUtils class for prompting a modal and asynchronously awaiting the user response.

{
     ...
     TestModal modal = await Context.Interaction.SendModalAsync<TestModal>(timeout: TimeSpan.FromMinutes(1));
     ...
}

Tho this may seem like a easy and foolproof way of getting user inputs inside a command execution body it should be noted that Discord doesn't send a gateway event for when a user dismisses a modal without responding. Which will result in this method to await until it times out, hogging resources needlessly in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant